/**
 * 公用创建方法
 */
export const createLayer = (layerId, groupId, viewer) => {
  let layer;
  if (layerId) {
    if (groupId) {
      let _layerGroup = viewer.getLFTLayerGroup(groupId);

      if (!_layerGroup) {
        _layerGroup = new DX5S.LFTLayerGroup(groupId, viewer);
        viewer.addLFTLayerGroup(_layerGroup);
      }
      if (!_layerGroup.getLayer(layerId)) {
        layer = new DX5S.LFTLayer(layerId, viewer);
        // console.log('进来创建图层了', _layerGroup, layer)/;
        viewer.addLFTLayer(layer);
        _layerGroup.addLayer(layer);
      }
    }
  }
  return layer;
};
